package com.rtos.model.cpu.registers;

import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import lombok.Data;

/**
 * @Author: biubiu0002
 * @Date: 2021-08-31 0:34
 * 数据寄存器AX
 * 饿汉式单例
 **/

public class AX extends AbstractRegister {
    private IntegerProperty visibleResult;
    private static AX ax;

    private AX(){
        visibleResult=new SimpleIntegerProperty(0);
        buffer=0;
    }

    public static AX getInstance(){
        if(ax==null){
            ax = new AX();
        }
        return ax;
    }

    public void visibleResult(int res){
        visibleResult.setValue(res);
    }

    public int getVisibleResult(){
        return visibleResult.getValue();
    }
}
